OpenStreetMap & Overpass Turbo

Foundations of Web Mapping: The Server-Client Model

Web-based Mapping Infrastructure https://dev.solita.fi/2018/01/05/gis-services.html

OSM

QUICKOSM Plugin - ingesting OSM data within QGIS

QUICK OSM

Quick Map Services

Quick OSM Interface

Key Value Combinations

Overpass Queries within QuickOSM Plugin

OSM_ID in Quick OSM

OSM_ID in OSM

Understanding OSM ID & Changeset ID:

Changeset + ID

Changeset

Overpass Turbo - querying OSM & creating extraction

Overpass Turbo Interface

Query Wizard

Export Queries

Save and Load Queries

Save and Load Queries

Practice Query #1:

Using the OSM tag Tag:amenity=drinking_water, set the bounding box to a larger scale geography featuring Lower Manhattan generally. Enact Wizard and search for Drinking Water followed by build and run query:

Drinking Water Query

Practice Query #2:

OSM data is composed of 3 core Elements, essentially the building blocks of its conceptual model of the world. These are Way, Node and Relation. An overview of all the Elements is available on the OSM Wiki Elements page. In the following query, only return Way elements within the key for highway which is structured as `highway=*:

Highway + Way Query

Practice Query #3:

All queries by default are geographically bound by the map browser frame bounding box. This default can be overriden by replacing the default {{bbox}} with (lat_min, lon_min, lat_max, lon_max) as follows for any/all included Elements:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“"fire hydrant"”
*/
[out:json][timeout:25];
// gather results
(
  // query part for: “"fire hydrant"”
  node["emergency"="fire_hydrant"](40.699544,-74.020386,40.710280,-74.002876);
);
// print results
out body;
>;
out skel qt;

Practice Query #4:

Queries can also be styled. In the following, Parks are returned with specified stlying:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“leisure=playground and access!=no and access!=private”
*/
[out:json][timeout:25];
// gather results
(
  // query part for: “leisure=playground and access!=no and access!=private”
  node["leisure"="playground"]["access"!="no"]["access"!="private"]({{bbox}});
  way["leisure"="playground"]["access"!="no"]["access"!="private"]({{bbox}});
  relation["leisure"="playground"]["access"!="no"]["access"!="private"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

{{style:
way{
  color: green;
  fill-color: green;
  text: name:en;
}
node{
  color: green;
  fill-color: green;
  text: name:en;
}
relation{
  color: navy;
  fill-color: green;
  text: name:en;
}
relation node, relation way, relation relation {
  color: green;
  fill-color: green;
}
}}

Practice Query #5:

The ‘everything’ Query:

[out:json][timeout:25];
(
  node({{bbox}});
  way({{bbox}});
  relation({{bbox}});
);
out body;
>;
out skel qt;

**Practice Query #6:

Returing to the original OSM Query for New York, the following Query returns explicit ID:

/*
This query looks for a node, way or relation 
with the given id.
*/
[out:json][timeout:25];
// gather results
(
  // query part for: “id:175905”
  relation(175905);
);
// print results
out body;
>;
out skel qt;